package com.qsw.paper.controller.user.student;


import com.qsw.paper.constant.MessageConstants;
import com.qsw.paper.pojo.dto.StudentsQueryDto;
import com.qsw.paper.result.Result;
import com.qsw.paper.service.IStudentsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author qsw
 * @since 2024-11-15
 */
@RestController("userStudentStudentsController")
@RequestMapping("/user/student/students")
@RequiredArgsConstructor
@Slf4j
public class StudentsController {

    private final IStudentsService studentsService;


    /**
     * 获取学生详细信息
     *
     * @param id 学生id
     * @return 学生实体
     */
    @GetMapping("/{id}")
    public Result<?> findDetailById(@PathVariable Integer id) {
        log.info("学生获取详细信息：{}", id);
        return Result.success(studentsService.findById(id), MessageConstants.SELECT_OK);
    }


}
